/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.q1.model.inheritance;

/**
 *
 * @author user
 */
public class Student extends Person{
   
    private int numCourse;
    private String[] courses;
    private int[] grades;
    private static final int COURSESIZE = 3;
    
    public Student(String name,String address){
        super(name,address);
        numCourse = 0;
        courses = new String[COURSESIZE];
        grades = new int[COURSESIZE];
    }
    
    public String toString(){
        return "Student :"+ super.toString();
                
    }
    
    public void addCourseGrade(String course,int grade){
        courses[numCourse] = course;
        grades[numCourse] = grade;
        numCourse++;
    }
    
    public void showGrades(){
        for(int i = 0;i < numCourse;i++){
            System.out.println("Course "+i+ " "+courses[i]+ " Grade "+grades[i]);
        }
        System.out.println();
    }
    
}
